package com.weixin.engine.controller;

import com.weixin.engine.daily.limiting.RateConfigAnno;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.support.TransactionTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class LimitTestController {

    @Resource
    private TransactionTemplate transactionTemplate;

    @GetMapping("/save")
//    @RateConfigAnno(limitType = "saveOrder", limitCount = 1)
    public String save() {
        log.info("123456");
//        transactionTemplate.execute(e -> {
//            System.out.println(111);
//            return true;
//        });
        return "success";
    }

}